import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
export default new Router({
  	routes: [
  		{
  			path: '/demo',
  			name: 'demo',
  			component: (resolve) => {
  				require(['components/demo'],resolve)
  			}
  		},
        {
            path: '/',
            redirect: '/petShop'
        },
  		{
            path: '/lose',
            name: 'lose',
            component: (resolve) => {
              require(['components/lose-list/list'],resolve)
            }
        },
        {
            path: '/pick',
            name: 'pick',
            component: (resolve) => {
                require(['components/pick-list/list'],resolve)
            }
        },
        {
            path: '/petShop',
            name: 'petShop',
            component: (resolve) => {
                require(['components/petShop/petShop'],resolve)
            }
        },
        {
            path: '/upload-pick',
            name: 'upload-pick',
            component: (resolve) => {
                require(['components/upload-pick/upload'],resolve)
            }
        },
        {
            path: '/upload-lose',
            name: 'upload-lose',
            component: (resolve) => {
                require(['components/upload-lose/upload'],resolve)
            }
        },
        {
            path: '/petInfo/:id',
            name: 'petInfo',
            component: (resolve) => {
                require(['components/petInfo/info'],resolve)
            }
        },
        {
            path: '/msg',
            name: 'msg',
            component: (resolve) => {
                require(['components/msg/msg'],resolve)
            }
        },
        {
            path: '/personInfo',
            name: 'personInfo',
            component: (resolve) => {
                require(['components/personalInfo/info'],resolve)
            }
        },
        {
            path: '/aboutme',
            name: 'aboutme',
            component: (resolve) => {
                require(['components/aboutme/aboutme'],resolve)
            }
        }
  	]
})
